Showing posts with label Windows Azure Learning. Show all posts
Showing posts with label Windows Azure Learning. Show all posts

Tuesday, February 10, 2015

PowerShell Suggestions : Write the Azure PowerShell Module version in all of your Azure Scripts.

 

She emailed me, Yes! "A Murky Ana!" and in the email she asked me that if it is necessary to document a "PowerShell Module version" in the "PowerShell scripts"?

I replied to her :-

Hi Ana!,

It's really good to document "PowerShell Module" version information of you are about to use a single PowerShell module only. For example, if you about to write a Long PowerShell scripts only for Microsoft Azure, then it's worth to mention a module version on the top of your PowerShell Scripts.

it's help other to check their Azure PowerShell module version before running your scripts so that no compatibility issues arises. If you like you can write a little bit tiny-miny PowerShell function to check the module version and only run the scripts if they match the desired version of the PowerShell modules.

09-02-2015 22-32-39

Checking the version of any module is very simple, just see the below command for an example.

PS C:\> (Get-Module -Name 'Azure').Version

Get-Module

I am hoping that you are able to understand now that it's a good to write the information of Module versions in the scripts.

* All characters appearing in this work are fictitious Any resemblance to real persons, living or dead, is purely coincidental.

 

Regards.

Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.

Tuesday, April 29, 2014

Pictures and Presentations of the Global Windows Azure Boot Camp 2014

Speaking at "Global Windows Azure Boot Camp 2014" was fun.  I take a session on "How to connect to Azure using our lovely PowerShell.

You can download the slides from the below link.

 

1000633_10152297231437969_1861321132_n1014480_10152297231807969_77521658_n1072258_10152297232072969_1581268407_o1075728_10152297231932969_814927800_n1477445_10152297231612969_1260443650_n1897718_10152297231707969_1438779005_n1976953_10152297231882969_1595178548_n1978800_10152297231517969_1690452904_n1979470_10152297231402969_13214403_n1979527_10152297231767969_2089856584_n1982165_10152297231857969_2102957527_n10003889_10152297231497969_1881559012_n10004038_10152297231637969_342120522_n10007033_10152297231987969_475617662_n10150531_10152297231572969_1943987801_n10152540_10152297231782969_1375317611_n10152680_10152297231452969_1412346725_n10153023_10152297231997969_1876953891_n10153100_10152297232017969_419633196_n10153887_10152297231677969_1177483347_n10176042_10152297231727969_1574740232_n

You can see my presentation slides below, you can download the slides from the SlideShare.com

 

Regards

Aman Dhally

If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.

Thursday, March 6, 2014

Part-3: Azure and PowerShell: Create a New Website on Windows Azure using PowerShell.

 

Part-1 : Getting Started With Windows Azure And PowerShell

Part-2: Connect To Windows Azure Using PowerShell

 

Hi, in my previous post, I had shown to you how to connect with “Windows Azure” using “PowerShell”.

Now, it’s time to “Do” and create something.

What about creating a website?

Nice idea! Isn’t!

Let’s get started.

In my Azure web portal you can see, currently I have no website.

clip_image002

 

Before open and start working on our “PowerShell” console, let’s have a quick look on what are the options those are required to create a website using Windows Azure web portal.

 

clip_image004

 

You can see in above picture, when we are creating a new website using “Quick Create” option in “Windows Azure” it is asking for provide  “URL” name and select a “Region”.

That’s fine. Let’s do it in our “PowerShell” way.

Open PowerShell console.

First, to get the list of geographical locations, we can use the “Get-AzureLocation” cmdlet. 

 

Run “Get-AzureLocation” cmdlet and pipe the output to “Select-Object” and choose Name property to select.

 

Get-AzureLocation | Select Name

 

Now we know which “Location” name has to use while creating a website. I live in India, to me it seems the “Southeast Asia” is a proper option.

clip_image005

 

Now the next step is to create a website.

For creating a website, use “New-AzureWebsite” cmdlet.

We are creating a website, using location “Southeast Asia’” and with a website name ‘ADhally’. 

New-AzureWebsite -Location ‘Southeast Asia’ -Name ‘ADhally’ 

 

clip_image007

 

When I run the above command, it throw the “EndpoingNotFoundException” error. I was wondering why it is not able to find endpoint.

To solve my curiosity, I checked the geographical locations available while creating website in the Azure web portal. And you can see there are no option of “SouthEast Asia” is listed.

clip_image008 

 

Ohk!

Now for me the closest option to “Southeast Asia” seems to be “East Asia” {because it has Asia word in it !! HA HA !) , let’s try that.

New-AzureWebsite -Location "East Asia" -Name "ADhally" 

 

It work well as expected, without throwing any error.

 

clip_image010

 

In hostname property it has given us the URL link to our newly created website.

Now’ let’s try opening a website which we have just created adhally.azurewebsites.net

 

clip_image012

 

Here you go, website is created successfully.

On our Azure web portal you able to see this newly website too J

 

clip_image014

 

To get the list of all of your website using PowerShell, you can use the “Get-AzureWebsite” cmdlet.

 

clip_image015

 

How to Video

Create a Website on Windows Azure using PowerShell.

 

That’s all for now J  see you in my next blog post.

Regards

Aman

clip_image017 clip_image018 clip_image019 clip_image020  clip_image021