How to find all Preview services in my Azure subscription? - azure

I have a few resource groups in my Azure subscription. Is there an Azure CLI Powershell script / command ---- to find all/any services that are being used which are in [Preview] and are not [Generally Available].

AFAIK, there is no way to do that via powershell or cli.
If you want to know if a service is in preview or generally available, check out https://azure-overview.com/.

Related

Pass Azure connection to console app in Azure DevOps pipeline

I have a custom console application that needs access to some Azure services (KeyVault, VM management, etc.).
I need to call this console app within a task in an Azure DevOps pipeline.
How can I pass an Azure service connection and use it from the application?
I thought that some information should be accessible in an Azure PowerShell task, but I can't find enough reference.
You may need to create a service principle and access the your azure subscription with this service principle.
Please refer document here to create a service and assign it to a role with the right permission to access your subscription.
If you would like to create service principle with azure cli, please refer steps here
To use the service principle in your console app. You can refer to this example.
Check here for more information about Azure Rest api. For Azure .net sdk please refer here
Well, it would depend on whether the specific build/release task that you're using supports passing Service Connection as an argument. Looking at the Azure Powershell task reference, I can see that azureSubscription parameter is accepted as an input to the task, which should let you configure your subscription.
Hope this addresses your query!

Why does Get-AzureStorageAccount give me different Endpoints than I see on the Azure Console?

When I look out on my Storage Accounts on the Azure console I see the vendorsdiag220, but when I do a Get-AzureStorageAccount from PowerShell I see two different names, neither of which is vendorsdiag220.
Also, neither of the two names are listed on the Azure console. What gives?
It sounds like your storage account "vendorsdiag220" is an Azure Resource Manager type (ARM), which uses portal.azure.com. The Cmdlet you mentioned is for the classic portal which uses Azure Service Management (ASM) and is at manage.windowsazure.com
This is a link to the ARM version of the Cmdlet.
https://msdn.microsoft.com/en-us/library/azure/dn495134.aspx
You might have to get the latest version of Azure PowerShell. Here are some instructions if you do:
https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/

How to get De/Allocated time for azure VM in C# or powershell

How to get De/Allocated time for azure VM in C# or powershell. I know how to list all the VM's But not sure how i can see De/Allocated time for each VM
This information is available in Azure Audit Logs. A feature of Azure Resource Manager (i.e. portal.azure.com - all resources created using "Resource Manager" and not "Classic").
You can read more about Azure Audit Logs and how to retrieve them here:
https://azure.microsoft.com/en-us/documentation/articles/resource-group-audit/

Only give PS access to a specific VM?

I have an VM running in Azure which I would like the client to be able to turn on/off easily. I tought this would be simple; just a PS-script that performs an startup/shutdown/dealloc. But it seems I can't generate a "Azure Publish Settings"-file that only gives access to that VM? At the moment it seems I can only control this at the subscription level?
The Azure Publish Settings file basically contains the access information for an entire Azure subscription. It does not specify access to a specific resource (e.g. VM) but to all resources inside of a subscription.
To limit access to a subset of resources in Azure, you should be looking at the new role-based access (RBAC) functionality, which is available in the Azure preview portal and the latest Azure PowerShell cmdlets.
How it works is that you create an Azure resource group, to which you can assign roles with specific rights, and to this role you can then assign individual users.
Check the following Azure documentation link for details on how to do this.

How to create an Azure Website programmatically using Azure PowerShell commands in C#?

I found all Azure Management Cmdlets here:
Windows Azure Management Cmdlets.
My question is how can I use these cmdlets in C# to create, remove and deploy an Azure Website?
Windows Azure managemnet cmdlets have been updated and now it includes web site creation. Check it here.
Without azure login we can not fire any command. We can Create Website in following steps.
Login to AzureAccount (Add-AzureAccount)
Setup The Azure Subscription (Get-AzureSubscription)
Select Azure Subscription (Select-AzureSubscription -Name AzureSubName)
Then We Can Deploy Azure site here
Ref to deploy site : http://blogs.msdn.com/b/cdndevs/archive/2015/04/23/azure-powershell-azure-websites-for-the-command-line-junkies-part-1.aspx
Here is a link to the samples from my book, PowerShell for Developers.
This example embeds the PowerShell engine in a C# application. You can then call the Azure PowerShell cmdlets and/or external PowerShell scripts that contain the workflow that you develop.
http://goo.gl/4kiYa

Resources