WVD - az cli sample for creating host pool, workspace and application pool - azure-cli

for an azure WVD deployment, I’d like to automate via az cli the creation of the following elements:
1 Host pool using a w10 image from gallery, automate the join to a domain and configure settings for remote desktop.
1 Workspace
1 Application pool, add some app to the list and authorize one or more AD user to it.
The only available documentation I have found is in https://learn.microsoft.com/en-us/cli/azure/desktopvirtualization?view=azure-cli-latest where there is just a list of available parameters without a detailed how to guide and some E2E sample.
Any advice?

You can refer to this documentation which explains how to do it using PowerShell. It's a pain it's just for one resource but still gives you an idea.
I'd also recommend your first step be to create what you need using the Azure Portal. This article explains how do to it from the portal.
Make sure to note down every field you're filling in, including the fields with default values.
Once you have created all the resources, you can now export an ARM template of the resources you have created, all customisation included. Look under the Automation menu of the resource, and click on Export template. You can use this template to automate your deployment.
Secondly, if you want to consider a different approach using another Infrastructure as Code tool, Terraform supports creating WVD objects. If you are familiar with Terraform, you can check this article which explains how to do it.
Let's assume you still want to proceed with Az Cli. I had a look at the az desktopvirtualization hostpool create help command in my CloudShell, I can see a disclaimer as follows:
Command group 'desktopvirtualization hostpool' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Here's a picture for root commands:
You have to bear in mind you will get limited functionality and limited support from Microsoft support/Azure team and possibly other members of the community, until the product at least in Preview. I gave it a try on my end and providing you the code here just to get you going.
Considering your requirements, I've tried to create some commands you can use. Some parameters (the IDs) were a bit vague and I had to look at the ARM template to find out what value I should put. The steps to deploy should be in this sequence.
Create a host pool of virtual machines.
az desktopvirtualization hostpool create --resource-group "myrg"
--host-pool-type "Pooled"
--load-balancer-type "BreadthFirst"
--location westus //only available in certain regions
--name "myhostpool"
--personal-desktop-assignment-type "automatic"
Create application groups.
az desktopvirtualization applicationgroup create --application-group-type "Desktop"
--resource-group "myrg"
--host-pool-arm-path "/subscriptions/<provide_subscriptionID_here>/resourceGroups/myrg/providers/Microsoft.DesktopVirtualization/hostpools/myhostpool"
--location westus
--name "appgroup"
Create workspaces.
az desktopvirtualization workspace create --location westus
--name "myworkspace"
--resource-group "myrg"
--application-group-references "/subscriptions/<provide_subscriptionID_here>/resourcegroups/myrg/providers/Microsoft.DesktopVirtualization/applicationgroups/appgroup"
To conclude, I've probably not spent enough time to really look into how much more it can be automated but I feel like, with the exception of ARM templates, other options will still require a fair bit of manual work.

Related

How to add a custom log with az cli?

In the docs, it shows how to create a table, but I see no parameter for setting the collection paths for custom logs (ex: /etc/log/nginx/error.log) the way you can in the portal.
az monitor log-analytics workspace table create --name
--resource-group
--workspace-name
[--columns]
[--description]
[--no-wait]
[--plan {Analytics, Basic}]
[--retention-time]
[--total-retention-time]
When I use show on a current table, I also don't see any collection path parameters or links to other objects where that might be stored.
As far as I know and as per this Git Hub document, adding custom logs using Azure CLI is still a feature request.
#LawrenceLLo AFAIK, Azure CLI currently doesn't support the above scenario. If this is something you would like to see supported, kindly share the feedback directly with the feature owner using this link.
Looks like there is already a feature request is in place, I would suggest you to Upvote and make a comment. Engineering will monitor this product feedback actively.
https://feedback.azure.com/d365community/idea/579dea67-2125-ec11-b6e6-000d3a4f09d0

Detailed description of all SCC's in OpenShift

Is there any documentation page, source code, config file that has the details of all SCC's and not just the Restricted (which is used as example in every bit of documentation)?
And I don't have a running OpenShift instance to inquire this from the commandline.
Here's what i mean by detailed:
https://docs.okd.io/latest/admin_guide/manage_scc.html#examining-a-security-context-constraints-object
Here is the design proposal of security-context-constraints

How to list untagged resources in Oracle Cloud tenant

How can you easily list all the untagged resources in a tenant? I tried the built in search capability, but looks like you can only search for specific tags and values.
Using the oci cli with the built in search capability I found the right command I need. In this example I used the owner tag withing the Monitoring namespace I created for tag defaults:
oci search resource structured-search --profile <ProfileName> --region <RegionName> --query-text "QUERY instance resources" --query "data.items[?!(\"defined-tags\".Monitoring.owner)].{\"Instance Name\":\"display-name\", OCID:\"identifier\"}" --output table
This will only list those compute resources, that do not have an owner tag (as it was created before tag defaults was introduced) or the owner tag is not set for any reason. This will help to find those resources, that need to be cleaned up in order to know the owner of each resource. Similar command has to be executed for other resource types though.
can you try without -c ocid? I'm suggesting since you could get the list for specific compartment.
OCI search does not officially support this use case
Search service do not list all resources : some services/resources are not intergrated with it.
If you really want to list all untagged resources in your tenant, I think you have no other choice to :
list all resources using each service command,
capture the API output,
filter for resources without tag.

wso2 1.10 store DefaultApplication Missing

I have installed a standalone instance of wso2 API Manager 1.10.0 with the CARBON-PATCH-4.4.0-0084 installed. I am walking through the PhoneVerification tutorial and have published the API as instructed. I created a new user for the store and am trying to subscribe to the PhoneVerification-2.0.0 API but cannot because there is no DefaultApplication in the Applications dropdown list. It is missing from the list. I tried to add and application and get an error dialog saying Missing Parameters. I am stuck and cannot go any further. One additional piece of information, I am using mysql instead of the h2 default. I followed all the instructions to setup mysql and had no problems. Also I changed the admin password as well.
I have tried API Manager 1.10 with security patch CARBON-PATCH-4.4.0-0084 with no issues. I can create APIs and subscribe using the DefaultApplication. I tried with default database and a new user who is assigned to 'Internal/subscriber' role.
Please check if you have any other changes for Store Web app at 'wso2am-1.10.0/repository/deployment/server/jaggeryapps/store'. You have to replace 'store' and 'publisher' apps as instructed in the Readme of patch.
(iii) Merge and Replace resource/store to /repository/deployment/server/jaggeryapps/store
(iv) Merge and Replace resource/publisher to /repository/deployment/server/jaggeryapps/publisher
To check if the Mysql configuration worked properly, please check if there are any errors in Carbon log, at 'repository/logs/wso2carbon.log' file related to that. And double check if userstore and api-manager database tables are created properly and configured in 'repository/conf/datasources/master-datasources.xml' properly.

Create a Spring Insight template

I am just listing here the basic steps to create a Spring Insight web application using Spring tcServer developer edition. I haven't found much doco regarding this, so it could help some people.
1 - Download Spring Tool Suite here
Download STS
Extract the archive somewhere on your machine, open a terminal and go to ~/tc-server-developer-[VERSION]/
2 - Run the following commands
./tcruntime-instance.sh create -t insight myInstance
This one creates a new tcServer instance based on the template insight. (full list of templates can be found in ~/tc-server-developer-[VERSION]/templates/)
Go to ~/tc-server-developer-[VERSION]/myInstance/bin/ and run the following
./tcruntime-ctl.sh start
This will start your tcServer instance based on the Spring Insight template. Check it is working by pointing your favourite browser to the URL http://localhost:8080/insight. That should display the Spring Insight index page.
Now you just have to drop your web app in the ~/tc-server-developer-[VERSION]/myInstance/webapps/ folder and Bob's your uncle !
Also wanted to mention how to set this up from the IDE without having to do any command line work
Assuming you have a spring mvc project open already in STS. This took a while to find so thank you for posting.
Add a new server from the servers window. Select the VFabric tcServer
Create new instance
When you get to the part where it asks you to select a template pick the insight template.
Add you app to the server you just created
Start the server
You will be prompted if youwant to activate insight, click yes.
Navigate to localhost:8080/insight or whatever port it is running on.
You can find more details here: http://pubs.vmware.com/vfabric5/index.jsp?topic=/com.vmware.vfabric.tc-server.2.6/devedition/install.html&path=2_3_1_0