How to use Azure CloudShell for Continuous Deployment - c#

I am using CloudShell to deploy Azure Services using PowerShell Scripts. It's a great experience.Now I want to use CloudShell to automate deployment. I am maintaining a solution in TFS/VSTS.
Is there any way or workaround to call OR to get the CloudShell instance or to run Powershell on CloudShell using some Batch command or C# or else.
Is any CloudShell API exist to use CloudShell service from .Net

No, there's no API behind the CloudShell, but its just a bash shell that's using Azure CLI and Azure Powershell. You can use those on your own.

You can access the open source project for Azure Cloud Shell on github and run the Azure Cloud Shell container locally using docker. Not sure this meets your need, but it's a cool option nonetheless.

As per my knowledge, Azure Cloud is an interactive, browser-accessible for managing Azure resources. You cannot use Azure Cloud Shell for Continuous Deployment.
Note: Azure Cloud Shell is an interactive, browser-accessible shell for managing Azure resources. It gives you the flexibility of choosing the shell experience that best suits the way you work. Linux users can opt for a Bash experience, while Windows users can opt for PowerShell.
For more details, refer "Overview of Azure Cloud Shell (Preview)"

Related

Azure Webjob: Git clone directly to remote

Im running a Windows-based App Service.
Im running a backup of a fairly large git repo and I'm wanting to clone directly to Azure Blob/File/S3. Cloning locally leads to an out-of-memory exception. I realise that you can mount azure storage, but this is just for Linux based apps.
Im using LibGit2Sharp ti run the Repository.Clone function. I've tried mapping a network drive on my Azure Webjob, but I get an "Access Denied"
When you create azure web app, if you choose option of Publish is Code, like below. It don't support net use command. These webapp are running in standard sandbox env.
Solution:
Create your web app like below. Docker Container will solve your problem.
Although the container webapp also runs in the sandbox environment, you can customize many configurations.
In local, I test net use command, which is same as windows container app.

Is it possible to install c++ compiler in azure app service

I have azure app service on Windows and I want to install c++ compiler on it.
I need the c++ compiler to compile and run c++ code runtime. The user submit some code(console application) I compile it and then run it with different inputs. I run command like g++ file.cpp for compilation and file.exe in cmd using Process class in c#.
Is there a way to connect remotely to my azure app service and install the c++ compiler? Or are there some other ways to install c++ compiler on azure app service?
No, you cannot install software (like your compiler) in an Azure App Service. https://stackoverflow.com/a/36185208/1537195
You would need to go to something like either your own container (see for example Azure Web App for Containers or Azure Container Instances) or host your custom code inside a VM.

How to run Office365 powershell in Azure Webjob?

I have a program which uses Office 365 Powershell to query O365 information. it works fine. Now, we want to use Azure and put this part into a webjob.
Now, we can pass the credentail into the powershell (using C# code), but when it runs as a webjob, it always shows error, see the screen shot. It says that the cmdlet is not recognized.
I know even on our local machine, we will need to install Windows Azure Active Directory Module to run Office365 powershell. Could the error be because in the Azure, it does not have this module?
So the question is: is there a way to install/integrate this into Azure webjob? or, is there other way that we could run Office 365 powershell in Azure webjob?
Thanks

How do I scale an Azure Cloud Service using SDK 2.4?

I seem to recall, that in the past, there was WASABi in Enterprise Library 5, which was used in order to scale Azure Cloud Services.
I've recently installed Enterprise Library 6 and noticed that WASABi is not a part of it.
How do I scale an Azure Cloud Service deployment nowadays?
Is it possible to set up the scaling solution locally for testing?
How do I scale an Azure Cloud Service deployment nowadays?
If you're looking to scale Azure Cloud Service in the cloud (and not on local emulator), you can make use of Azure Auto Scaling. You may find this link useful for that: http://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-scale/.
Is it possible to set up the scaling solution locally for testing?
It is not possible to do so in SDK 2.4. This is one of the breaking changes in SDK 2.4. From the SDK 2.4 release notes:
The Full Compute Emulator is deprecated- The Full Compute Emulator is
deprecated in SDK 2.4. As with SDK 2.3, all new Cloud Services
projects now use Emulator Express by default. Emulator Express allows
you to test your multi-role Cloud Services locally without requiring
administrator privileges. Unlike Full Compute Emulator, however,
Emulator Express only supports one instance per role.

Deploying a sql server based webservice on azure virtual machine

I have developed a web service in VS2008 in C#. The service queries a SQL Server Express 2012 database and returns the results. When I test the service on local development system it works fine.
Now I have a windows azure trial account, and I want this service to be deployed on a virtual machine.
1- I have tried to create virtual machines with SQL server and Visual Studio on it, but could not create the service there. VS does not have the Web services template there.
2- I have tried to create the deployment package on my dev system and tried to install the service but it also did not work.
Please suggest the correct way of doing this task. I am very much new to all these concepts so may be I am missing some basic information and a step by step guide will not hurt.
Install Visual Studio 2012 Express for Web
Get your application working in that version, and preferably upgrade it to .NET 4.5.
Create a Windows Azure SQL Database by following this Getting Started guide.
Download version 4.0.15 of the SQL Azure Migration Wizard from CodePlex.
Use the wizard to migrate your local database to Azure, being sure to fix all the problems it reports.
Set up a Windows Azure Web Site and publish your service to it as described in this article.
I am not sure that you did it that way, but the easiest way to create a cloud-hosted web service with MS SQL Backend would be:
Create a new instance of SQL Azure in Azure Management Portal.
Create a new database (probably a web edition in your case).
Use the connection string from the portal and Azure SDK to develop an ASP.NET application (web role) hosted on Azure. You can locally test this application in the similar way how you test your current ASP.NET application, provided you set up the firewall on your SQL Azure instance for inbound connections from your external IP.
(here is the step-by-step tutorial for the first three steps)
Create a new instance of cloud service in Azure management portal.
Deploy your application to the cloud directly from Visual Studio. You'll, however, need at least Visual Studio 2010 and the Express Edition would already do.
(Update: As Mark Rendle suggests in the comment and in his answer, there is no need to create a separate cloud instance as long as your service is light-weight and does only data fetching. Cloud instance would be, however, essential, if your service requires data processing or has some other logic entailing long-running processes).
Alternatively you might want to use Azure Mobile services, that already provide a web service for SQL Azure that might do. This is a fully RESTful web service and you'll just need to write some logic in JavaScript, similar to Node.js implementation. See an excellent tutorial on this issue.

Categories

Resources