How to add PowerBI Gateway to existing cluster using PowerShell Cmdlets? - powershell

I managed to install PowerBI Gateway programatically
Install-Module -Name DataGateway -Force -Scope AllUsers
Login-DataGatewayServiceAccount
Install-DataGateway -AcceptConditions
Now I am looking for a way to add this gateway to existing cluster. There is a function to remove gateway Remove-DataGatewayClusterMember, but for some reasons there is no function to add.
Is there anyway to add PowerBI Gateway to existing cluster using PowerShell Cmdlets or something else?

No, there is no way to add a cluster to an existing gateway. That cmdlet will only setup and create a new gateway cluster with the machine. Suggest you submit feedback for the Microsoft Power BI team here:
https://ideas.powerbi.com/

You cannot do it via Powershell as of today but you definitely do it using the UI. Here is an article that can help you.
add-another-gateway-to-create-a-cluster

Related

Create and Publish Azure classic Cloud Service project with AzureRM powershell

Even after looking at the docs, I couldn't find a way to do this with the AzureRM powershell cmdlets. Does anyone know how to do this?
The old Azure Service Management powershell cmdlets have a Publish-AzureServiceProject, but I believe it is deprecated now.
EDIT: Supplement Answer to yoape's answer below
You can create a new classical cloud service project using something like this:
New-AzureRmResource -ResourceType "Microsoft.ClassicCompute/domainNames" -Location "centralus" -ResourceName "myCloudServiceProjectName" -ResourceGroupName "myResourceGroup"
Where Microsoft.ClassicCompute/domainNames is the magic sauce one needs to create the desired classic cloud service project.
However, (afaik) you will still need to deploy/publish the classic cloud service via the old cmdlet: Publish-AzureServiceProject. Using the above cmdlet lets you create the cloud project in the proper resource group though.
The classic compute services are basically not supported by the Azure Resource Manager model. This means you cannot use the AzureRM cmdlets for publishing your Cloud Services.
The Publish-AzureServiceProject cmdlet from ASM is not depricated (yet), you can still use it (in fact it is still the only way to publish your Cloud Service from PowerShell). Perhaps you where thinking about the deprecation of the Switch-AzureMode cmdlet?

Automating database creation using an Azure Powershell Runbook

I am attempting to automate the creation of a database server and database using an Azure powershell runbook.
I have managed to create the server ok, but when I then try to connect to it to create the database and user, I hit firewall issues.
I cannot find a way to get the IP address of the runbook so I can add a firewall exclusion.
Any help appreciated!
After you create the server add the firewall rule that allows Azure services access to it.
New-AzureSqlDatabaseServerFirewallRule -ServerName [your_server_name] -AllowAllAzureServices

How to add an SSL certificate to an azure website using powershell?

I am working on automatic deployment + azure. I'm at the point where i'm adding an ssl cert to the website. Does anyone know how to use PowerShell to upload an SSL certificate to a website using the PowerShell command (Add - Get - Set based commands)? I'm able to add a certificate to a cloud service using ...
New-AzureService $Program -Location 'East US'
Add-AzureCertificate -Password Cert123! -ServiceName $Program -CertToDeploy $CertLocation
but I have no idea how to add it to an azure website.
Thanks
edit: I've found a way using the following command, but i'm not wanting to install additional libraries on my production deployment machine.
azure site cert add -k Cert123! $CertLocation $Program
Using the newly released Azure PowerShell v. 1.1.0, you can use the following command to upload a certificate to your website
New-AzureRmWebAppSSLBinding -ResourceGroupName myresourcegroup -WebAppName mytestapp -CertificateFilePath PathToPfxFile -CertificatePassword PlainTextPwd -Name www.contoso.com
More information is in the following article
https://azure.microsoft.com/en-us/documentation/articles/app-service-web-app-powerhell-ssl-binding/
As far as I know the Azure PowerShell cmdlets do not offer this capability at the moment that I could find. As you point out the Cross Platform Command Line tool does. Since you don't want to add the XPlat-CLI tool to your deployment machines you can use what the XPlat-CLI tool does under the hood: a direct call against the REST api for web site management.
Note you'll need to figure out what webspace the site resides in, etc. You can use the Invoke-WebRequest to make this call so that you can verify you get that 200 response back. Or you could use the Invoke-RESTMethod as well, but that would only return an XML document (the contents of the response). The Invoke-WebRequest provides you a little more control and access to the full response object.
The Microsoft Azure Management Libraries (which the PowerShell cmdlets sit on top of) has a Web Site Management piece to it. One of the operations is an update to a site and that includes a WebSiteUpdateParameters object with a SSLCertificates property. You may check into that as well, though I've not done this myself.

How to use PowerShell to get information about a Staging Windows Azure WebSite slot?

I'm using the PowerShell CmdLets to automate most tasks against Windows Azure Cloud Services and Windows Azure Web Sites.
For Cloud Services, I can use the Get-AzureDeployment CmdLet. However, the similar Get-AzureWebSiteDeployment CmdLet requires Git to be installed before it can run and does not seem to be designed for the same task.
As far as I can see, the Get-AzureWebSite CmdLet only ever retrieves the "Production" slot of a Windows Azure Web Site.
How is it possible to get programmatic access to the corresponding "Staging" slot ?
We are working on some PowerShell cmdlets to support website slots. We are very close to releasing it. Keep an eye on this repo on github. https://github.com/WindowsAzure/azure-sdk-tools
Current date update (Jul 19 2015):
According to Azure Docs Web Sites Staging Slots there are new CMDLets that support querying Slots:
Show-AzureWebsite -Name webappslotstest -Slot staging
And some others cmdlets extended with -Slot attribute (Create New Website, Remove, Switch Slots).

How to control Azure VMs using Powershell

Hello I´m trying to automate AZURE VM management like Amazon EC2.
Is there any way to manage AZURE VM from Powershell like Amazon EC2 API ?.
I can´t find API easily documentation or how to do it.
Thanks in advance :)
Windows Azure Management Cmdlets lists a number of AzureVM cmdlets.
Add-AzureDataDisk : Adds a new data disk to a virtual machine object.
Add-AzureProvisioningConfig : Adds the provisioning configuration to a Windows Azure virtual machine.
Add-AzureEndpoint : Adds a new endpoint to a Windows Azure virtual machine
Export-AzureVM : Exports a Windows Azure virtual machine state to a file.
.....and tonnes more
Do these not cover what you need?
Windows Azure has a REST-based API for just about everything, including the management API. Additionally, the API has a corresponding set of Windows Azure PowerShell cmdlets that you can call, which essentially lets you automate your entire deployment via PowerShell.
The most recent version, 2.2.2, has the ability to persist subscription settings, obviating the need for repeating parameters such as subscription ID and certificate thumbprint. Michael Washam, Technical Evangelist, blogged about v2.2.2 here.