Hi I am a beginner in windows azure. I want to create an instance in windows azure and later power it on and power it off programatically with C# code. I have written code to perform these operations in hyper V server using WMI but I do not understand how to do it using the windows azure API. Please help me to do this. If possible please give me the code so that I can follow it easily.
code to power on and power off an instance in windows azure
576 Views Asked by Sandhya Akkasali At
1
There are 1 best solutions below
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in .NET
- Does compiler optimize operation on const variable and literal const number?
- What is the point of definnig Asp.net Intrinsic Objects In different places and what is the different betwen them?
- Deleting Orphans with Fluent NHibernate
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- What is this namespace ITypeOfObjectsBoundToListBox ? Couldn't find it
- .net rest service with JSON string and consumed with java client
- What is best way to check if any of the property of object is null or empty?
- Telerik's WPF RadColorPicker NoColorText property not working
- Possible consequences of duplicate ProgId for different classes
- How are multiple requests to Task.Run handled from a resource management standpoint?
- Optimizing C++ call from C#
- Make a per-web-application object available to Web API and SignalR controllers
- System.ComponentModel.DataAnnotations.Schema namespace conflict
- LINQ Except/Distinct based on few columns only, to not add duplicates
- Not displaying content by its URL string - absolute urls
Related Questions in AZURE
- Why does Azure Auto-Scale scale go lower then minimum amount of instances?
- Data execution plan ended with error on DB restore
- Why does Azure CloudConfigurationManager.GetSetting return null
- Do I need other roles than Worker Role for a web site and service layer in Azure?
- Azure Web App PATH Variable Modification
- Azure Data Factory: LinkedService for AzureSql in failed state
- How To Update a Web Application In Azure and Keep The App Up the whole time
- Using Azure MobileServices library with my own LAN WebApi
- ionCube loader error on Azure IIS
- App crash (if closed) after click on notification
- How to get sql data bases instances in azure using java api
- I want to create file in azure share using python PUT requests but getting error signature not correct including headers
- Enabling OPTIONS method on Azure Cloud Service (to enable CORS)
- Redirecting subdomain to directory on Azure
- Kaltura account settings error
Related Questions in CLOUD
- Cloud Connection with Java Window application
- CometCloud installation, and possible alternatives
- Creating a scalable database for android app | cloud hosted
- Arduino NearBus NearbusEther_v16.h: No such file or directory
- how to measure Software as a services performace
- Did google change/update related to vm ssl connections to Cloud SQL?
- Pinging a private IP from one private subnet to another private subnet
- Evernote authentication not working via evernote android sdk
- When upload Bitmap stream to Azure storage, it store zero/empty image
- How to connect Clusterpoint database to an android appliaction
- Installing CouchDB on IaaS?
- Error while creating Instance in gcloud ?. How to create an instance using Google Cloud
- In Spark, does the filter function turn the data into tuples?
- Which language to choose? #suggestions
- Dropbox for local development, Git for cloud
Related Questions in AZURE-CONFIGURATION
- How to get full list of CloudConfiguration from inside a web service at runtime?
- Setting Up And Using Web Deploy with Azure WebRole in Visual Studio (One-Click partial update)
- What is a "node" in OMS/Log Analytics?
- How to find an Azure instance role size programmatically?
- Windows Azure Connection Strings - How to Handle Local vs. Production?
- How to set the default subscription in the Windows Azure Portal?
- How can I add a Json string in a launchsettings.json file in my app and read the values?
- How to specify which ports my Worker Role needs?
- How do I create a copy of my application in Windows Azure?
- code to power on and power off an instance in windows azure
- Can a WebRole be "recycled" programmatically?
- Application startup task failed with exit code 1 when Deploy on azure
- Windows Azure Web Role Log files
- azure service definition localstorage element
- How configure Azure function project in Intellij/Pycharm run/debug configurations on mac
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The answer is: You can sort-of do what you're asking. Each role in your deployment defines a particular VM (Windows 2008 Server with whatever code you write that gets deployed to it), and each role must have one or more instances. So: As long as you're ok scaling from 1 to n instances (but not 0), you can sort-of make this work.
Why sort-of? When you power down instances (e.g. go from 4 instances to 3), you cannot selectively choose which instance gets powered down. Therefore, a good pattern is to work with stateless operations. Let's say you're reading from a queue and doing some processing. In the event one of your role instances gets shut down, then you can simply stop processing queue messages, finish whatever message(s) are being processed (within a few minutes' time), then the instance shuts down and other instances continue processing.
Ok, now for the last part: To change instance count (assuming you're ok with what's described so far), you'd need to change the deployment configuration, which holds settings for number of instances for each role. To do this with C#, you'd need to call the Service Management API, which is REST-based and fully documented here. Having said that: There are Windows Azure PowerShell cmdlets that greatly simplify this, and can be called from any of your roles (or from an on-premises machine). If you really want to make these calls with C#, check out the csmanage example, written in C#.