Skip to main content

· 4 min read

I have been using twitter for the past 10 years and it took nearly 5 years to get those 100 followers. I was not an active user till before 2 years. One great tip i learnt in recent times is that first thing you need to do is to get a really complete and professional profile. Most users look at profiles before following. Another best way is to increase followers on Twitter is being consistent with posting quality content. Automating your posts will help a lot with this. In this blog, i will explain how you could build a simple function and deploy it on Azure to increase your followers count and to be consistent with quality content.

PreRequisites:

Step 1 : Navigate to https://portal.azure.com/ and search for Function App in the search bar.

Step 2 : Create a Function app with the following settings, make sure you are setting the Consumption Plan and enable Application Insights.

Step 3 : Open Visual Studio Code(Make sure you have already installed the VSCode with the function core tools and extension). Select Ctrl + Shif + P to create a new Function Project and select the language as Python

Step 4 : Select the template as Timer trigger as we need to run every 15 minutes and you need to configure the cron expression (0 */15 * * * *) as well.

Give the function name as twitter_followers,

Step 5 : You will see the project template getting created. Next step is to edit the __init__.py, thats where you are going to add the logic. We will be using Tweepy library to get the data from twitter and to follow the person who is tweeting the tweet. The methods we will use in the function as retweet and create_friendship. Here is the whole logic of the function. As you can see any tweet that has the hashtag #azure will get retweeted and you will automatically follow the user who has tweeted the tweet.

import tweepy, time, datetime, logging, os
from datetime import date
import azure.functions as func
def main(mytimer: func.TimerRequest) -> None:
utc_timestamp = datetime.datetime.utcnow().replace(
tzinfo=datetime.timezone.utc).isoformat()
if mytimer.past_due:
logging.info('The timer is past due!')
logging.info('Python timer trigger function ran at %s', utc_timestamp)
auth = tweepy.OAuthHandler(os.environ["TWITTER_CONSUMER_KEY"], os.environ["TWITTER_CONSUMER_SECRET"])
auth.set_access_token(os.environ["TWITTER_ACCESS_TOKEN"], os.environ["TWITTER_ACCESS_TOKEN_SECRET"])
api = tweepy.API(auth)
today = str(date.today())
while True:
for tweet in tweepy.Cursor(api.search,q="#azure", lang="en", since=today).items(1):
try:
api.retweet(tweet.id)
except:
pass
try:
api.create_friendship(tweet.user.id)
except:
pass

Step 6: As you can see there are few environment variables which we are using in the code, we need to add those variables with the values in the local.settings.json file.

{  "IsEncrypted": false, 
"Values": {
"TWITTER_CONSUMER_KEY": "",
"TWITTER_CONSUMER_SECRET": "",
"TWITTER_ACCESS_TOKEN": "",
"TWITTER_ACCESS_TOKEN_SECRET": "",
"FUNCTIONS_WORKER_RUNTIME": "python",
"AzureWebJobsStorage": "UseDevelopmentStorage=true"
}
}

You need to get those keys from the twitter application you already created. if you dont have one, create from here.

Also you need to add the dependencies which are used in the above code inside the requirements.text file. dependencies.txt would have the following,

azure-functions
tweepy

Step 7 : Now we are done with everything, to publish the app to Azure, just press Ctrl+Shift+P and select Deploy to Funciton App

Step 8 : You can navigate to the function app on the Azure portal and make sure Application Insights is configured and as well as AppSettings are correct.

Make sure all the Environment variables are configured with the values.

Now you can start your function and navigate to Monitor section of the function app. You will see the real live telemetries from the app as follows,

All good, you can see the function running and you will see the tweets are automatically retweeted with the particular hasthage in your timeline and also you will see the number of followers increased. Happy Tweeting Folks!

You can get the sourcecode from here.

· One min read

I have been answering questions on Stackoverflow since 2011, and recently i started answering questions on #Azure. I was amazed to see the growth of Azure in the last 3 years among developers which is almost 200%. More the questions means more are implementing solutions on Azure.

I just checked the growing trends of different cloud provides including #AWS and #GCP , you can see the growth of Azure in the image below.

As i mentioned in the newsletter recently published by Trident(Cloud solution provider) Azure is becoming the Cloud that developers love the most in recent times.

Keep building more solutions and innovate on Azure.

· 4 min read

Technology is moving very fast and it’s hard to keep up, but you always gotta find a way to keep updated! Especially in the cloud's world it is mandatory to keep your knowledge updated everyday. Every social media is a great place to know about what’s happening around,new innovations and stuff. As there are many services/features been announced every day on Azure, This blog helps you to unleash the power of AzureCharts which is a great resource that help to track Azure updates. AzureCharts is a set of auto-rebuilt charts to keep you updated on Azure changes, news, stats. Public updates, RSS channels and web pages are used as data sources.

Before few weeks I saw a tweet from mark russinovich who is the CTO of Azure definitely somebody that you should follow if you want to learn about Azure.

As you see, he mentioned in the tweet if you want to see exactly what updates were making to Azure services check out this cool site that lets you see all of them as your charts. This site was developed by one of cloud solution architects Alexey Polkovnikov. Azure charts is not a Microsoft service or product, this is just a personal project of him and quite honestly I think this is awesome. He has delivered a great way to consolidate everything going on in all of the different update points of Azure which cover things like RSS feeds the azure updates page news statistic other public updates so this is just an awesome place to come and see exactly what's going on.

HeatMap View:

It pulls the update from portal and other locations in order to give us many things including a heat map view. Now you have one place to come where you can see everything across all major pillars and services in Azure.This is just absolutely amazing so this heat map view specifically digs into the hottest areas of azure update items.You'll find those across the top and they are the most highlighted in color and we have many different ways that we can look at and slice this data up. You can also look at this in terms of regions and data centers which features are being deprecated in this retirement section,things security compliance open source and other azure services and individual feature updates.

Addition to that you can look at this based on a specific measure role. For example, if I am an Azure developer then I would care about what's going on with the SDKs and specific features that are here.

SLA

It is very difficult to keep track the SLA of each and every service on Azure. This feature becomes very handly, if we click on this tile it takes us over to the SLA page and you can see the SLA details a and then you can read up about that and the different service levels.

Regions

Region look up is a pretty cool feature this is where we can take aparticular geography and again compare it to another region but a little more. specifically, if you want to look at features that are GA in the United States geography regions or what is GA in preview GA preview and future you will just select GA and hit search regions and of all of these services.

Fun

Last but not the least, Quize helps you to validate the knowledge on different services with bit of gamification as there are different multiple choice questions.

Thanks Alexey for putting this together and this should be a shout out for everybody to go explore this tool and give your feedback. Definitely this would help in some way.

· 3 min read

This week I participated my first ever OpenHack on DevOps organized by Microsoft in Singapore. It was a three day event from 26th-29th November 2019. The hackathon was focused on Azure DevOps and Azure Kubernetes services. There were participants from all over the world gathered at one place.

There were over 90+ Participants comprised of internal employees as well as customers. Participants were divided into 6 members per team with one coach. The content was set as 8 challenges. Coach from each team was some Cloud Solution Architect from Microsoft who was helping and guiding the team during the challenges with some hints to solve it. One of the cool thing of the hack was that each team could apply their own solutions in unique ways. We as a team were supposed to find our way out to solve the challenges. There was no one way, we were free to take our decisions and paths as deemed fit. If you are wondering about the agenda and what happened in the hack, here you go.

My Team RockStars - Announced as Happiest team among all

What I really liked about the openhack was that each team member was really able to understand what's the challenge and was able to get the team's support whenever they're stuck. Before we start each challenge, one member from the team was assigned as a Scrum Master and he has to drive the entire team to complete the challgne. In each challenge, one has to elloborate the feature of whatever the tools/technologies that we would use in the challenge. There was whiteboarding session included in each challenge before we get in to try to solve the challenge. It was a hands-on rather than attending any tech talk about a specific topic. The tasks were set, challenges were well organized, the environment was prepared, code was almost prepared (with some changes) so that we can focus on learning how we can use Azure DevOps as a tool to ensure zero down-time for production ready application. Kubernetes was chosen as an orchestration framework. Azure monitor was used as the Monitoring service.

Microsoft OpenHack is a developer focused event where a wide variety of participants (Open) learn through hands-on experimentation (Hack) using challenges based on real world customer engagements designed to mimic the developer journey.

For every challenge the links to documentation and resources were provided to understand relevant topics and areas at hand. Besides the actual work, it was a great opportunity to network and discuss broader topics with fellow team members and other participants. It was not just about solving challenges, but each one was appreciating others work whenever we accompolished something. we were given with some cool swags including stickers,notebook wireless charger and Azure Devops badge.

There was not a real winner(team) out of this openhack, all the teams who participated thoroughly enjoyed and it was about sharing and solving real issues.Overall, I think it was a great learning experience for all the participants with great focus on getting things done. I will definitely keep an eye on such events in the future and try to join as a Devops coach for the upcoming events. More than the hackathon it was not just about technology but about teamwork. If you want to have the same experience try to join any of the OpenHacks from here.

· 2 min read

One of the cool feature that Microsoft teams provide is that you can load any website as a tab on particular channel. One handy thing i noticed is that if you want to access azure cloud shell in teams you can just add it as a separate tab and manage the resources without navigating to the browser. With simple step you can access your azure portal as a tab in your teams.

Step 1 : Goto your channel on teams and click on + (Add tab)

it will open up a window.

Step 2 : Just type website in the search tab and you should be able to add a new website as a tab.

Step 3: Just add http://shell.azure.com as a website tab and thats it. Now you should be able to execute all the commands without opening up a shell.

You can do the same with most of the frequently accessed websites if you want to demonstrate something while you are on teams. I have done with Stackoverflow and it's really helfpul while github can be added as a separate tab from the available list.

Try it out today, eventhough it is not helpful as the page refreshes when you move to another tab and come back, but really a good feature to have as a developer. Here is a small gif demonstrating how effectively you can navigate between those tabs.

Microsoft teams is getting better with much features day by day!