Create Collection in CosmosDb via Powershell - powershell

Is there a way to create cosmosDb collections via Azure Templates or via Powershell?
All i have got so far are examples with the Azure CLI, but those do not fit my requirements.
I would also like to avoid Rest Calls, since this seams like a lot of overhead compared to the a possible Powershell solution.

Based on the information provided here, you can only perform account related operations with PowerShell. It is not possible to manage data inside an account using PowerShell as of today.
The following table includes links to sample Azure PowerShell scripts
for Azure Cosmos DB. At this time you can only manage the Azure Cosmos
DB accountlayer via PowerShell; other resources such as databases and
collections cannot be managed via PowerShell.
Also looking at the Azure Feedback site here, it is still unplanned but someone has started a project on Github for this. Do take a look at that project here: https://github.com/secabstraction/PoshDocs.

You can use the Cosmos DB PowerShell module available on the PowerShell Gallery. You can find the documentation and examples of how to use it on GitHub in the project repository.

You can try calling the REST API from powershell to achieve your goal SEE REST API Dcumentation here

Related

How to connect to saucelabs via Azure devops?

I need to test a connection to sauce labs from Azure devops but struggling to find the correct syntax for this?
This article talks about Sauce Labs w/ Azure DevOps.
You will face issues setting and reading environment variables. Assuming that you are using C#, this topic is covered there as well.
A NodeJs and a Java example is there as well.
One thing I will say confidently is that you definitely want to use a YML file to make Azure Devops connect to Sauce.
Another gotcha is the fact that the Sauce plugin doesn't actually work and you can't use it to see videos. Hence, don't use it. Just configure the YML file as described in the linked resources.

How to deploy SQL Database in Bitbucket pipeline to Azure

Asking for an opinion or direction on the current problem.
We are using bitbucket pipeline to deploy ci/cd web applications to Azure. Now what is remaining - the database, also being hosted on Azure.
From my research - everything on SQL Database Projects deployments usually utilizes Azure DevOps pipelines (connects to github repo, allows plural environments, has a built-in SqlAgent allows deploy SQL db to the target server via dacpac file. It allows CI with every check-in, every time you push changes. Nice!
But what if can not (for some reason) use Azure DevOps and have to utilize Bitbucket pipelines instead. is that possible? how? via scripting? a tool? to call in the command line? Any help - highly appreciated.
It's true that in Azure DevOps it is easier to deploy (Azure) SQL Database, as Azure DevOps offers many tasks (including 3rd party custom tasks you can find in Microsoft MarketPlace).
However, no matter what tool will you use, you should be able to do the same, knowing the concept of deployment of a specific service.
I don't know BitBucket very well, but I bet the product has the capability to execute some commands, including PowerShell commands as well. If so, you must do 2 steps in your pipeline to publish Azure SQL database:
1) Create server and (empty) database - perhaps BitBucket offers some task for creating services in Azure (from ARM template or other way). If not - you can always use CLI or PowerShell to do so. More info: az cli server
2) Deploy the database or changes to it. This step is always to compare DACPAC file (which is compiled version of SQL Server database project) to target database on the server. The result is T-SQL (differential) script which must be executed against the target database. There is only one way to do so - sqlpackage.exe - tool provided by Microsoft. You can find the whole documentation here and plenty of examples on how to use it on the Internet.
Let me know if that helps.

Can I create a project template in Azure DevOps

My company creates a lot of projects in Azure DevOps, and they all have the same structure -- same members, same permissions. Each project has different Git repositories within it, but that's the only thing (other than the name) that differs between them. It would be helpful to have a template so that everything is set up correctly each time we need a new one.
I don't see a way to do this through the web interface. I have the sense that I could probably do it with a script, but I don't know where to begin with that (including which tool to use). Where should I start?
It looks like there is now a way to do this without the Azure DevOps CLI (as long as your project that you want to template is one of the supported types (Agile, Scrum and Basic)). There is a tool available here that will step you through the process.
There is also an excellent blog post here that gives you an overview.
Yes, you can accomplish most of the configuration by script. For the beginning you might take a look at the Azure Devops CLI, which allows you to perform several actions on Azure Devops, like:
Create projects, Users and configure security
Create repositories, pipelines and set branch permissions
Create and manage work items
...

How to use SharePoint Migration API without uploading data to Azure

Is there any possibility to upload data to SharePoint Online using Migration API, without uploading package to Azure Storage. I have referred some Blogs and they are suggesting to upload package to Azure Storage via Powershell
The closest thing you can use is the direct migration using PowerShell, it will not use the Migration API and of course, no Azure will be required.
I've created a custom solution for migration, it supports metadata and allows you to migrate file shares and local folders, not sure if it will be helpful for you but take a look:
https://github.com/MrDrSushi/SPOPSM

How to create a new Azure Website with integration to private Github repo using the Azure REST API?

There are many trivial examples that show how this is done without the Github integration. The Azure Powershell commandlet New-AzureWebsite supports only public repos (can be confirmed from source code [1]). Has anyone tried to create it with a connection to a private repo? It doesn't seem to be documented anywhere.
UPDATE: I've realized this might be something Kudu helps me with.
[1] https://github.com/Azure/azure-powershell/blob/e06a22c22f7a1c8153e9c2fa7c159ae7b1fd1dab/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/GithubClient.cs#L124
We have not added the functionality to powershell. However, you could try using the ARMClient tool below to achieve just that. See its readme and wiki for info.
https://github.com/projectkudu/ARMClient
https://github.com/projectkudu/ARMClient/wiki/Setup-GitHub-publishing-to-Site