Unable to remove faulted Node using Remove-ServiceFabricNodeState any more - azure

I used to use Remove-ServiceFabricNodeState to remove faulted Service Fabric nodes. with this cmdlet i was able to remove a specific node by its name.
However I'm unable to use this cmdlet any more. It is not allowing me to install the module using Install-Module ServiceFabric anymore saying the module cannot be found in the gallery.
Also I'm unable to find a similar cmdlet in iether Az.ServiceFabric or az cli. all that is available is a Remove-AzServiceFabricNode which cannot specify which node I want to remove. It just accepts an integer for how many nodes I want to remove.
I would like to know how can I remove a Node by its name?

To use Remove-ServiceFabricNodeState, just need to install the Azure Service Fabric SDK, it also includes the runtime and tools, after installing it, reopen a PowerShell session, you will be able to use the command.
Besides, you can also use the Azure Service Fabric CLI command sfctl node remove-state as mentioned in another reply, all depend on your requirement.

You can use Azure Service Fabric CLI with
sfctl node remove-state --node-name Node01 --timeout 60
This will remove the state of Node1 with a timeout of 60 seconds. Documnetation
For more information on how to install sfctl see how to install sfctl
Simple version:
Install Python (Version 3.X)
Install Pip
Execute the following command pip install -I sfctl==9.0.0. See table to see which version you need.

Related

How to fix the bash az-command not found

I am trying to install Azure CLI on my raspberry pi 3 which runs Linux OS. I followed this guide, but it gives me this error: bash az-command not found. I search online and found no solution to this error.
To install Azure CLI, the simplest way is to follow the steps in the link provided. But it seems you use the second way. So you can't run the command apt install azure-cli directly. You need to prepare the dependencies for the Azure CLI. And you also need to make sure if your network is OK. In the end, I recommend you use the first way that runs the shell script.
I am facing the exact problem. i did "docker run -it mcr.microsoft.com/azure-cli" without the quotation marks

Error when install Azure-Cli on my self hosted windows agent

I have Azure DevOps pipelines using my Windows Self-hosted agent on my intranet.
I want pipelines to create universal packages and I read that I must install an extension to Azure-Cli on the agent for this.
After several errors where system team helped me setup proxy and all, I run this command in elevated command prompt:
az extension add --name azure-devops
I have this error message:
Unable to get extension index.
Response body does not contain valid json. Error detail: Expecting value: line 1 column 1 (char 0)
What could be the issue ?
First of all, as Doris said, you need meet the most basic conditions for installing the azure-devops extension, that is, the version of az cli should be higher than 2.0.69. But as far as I know, this should not be the cause of issue you encountered.
azure cli along with extensions are all built with python. So you will find that "Error detail: Expecting value: line 1 column 1 (char 0)" is a normal JSONParseDecode error if you google it. It has many causes, like empty response, non-json response content, 500/503 error and etc. Without internet trace, I'm afraid it's hard to find the exact cause of it.
Work around:
========================================
To work around this issue so that you can use az devops command to achieve your goal, you can follow below steps:
1) Install the corresponding whl file into your local machine.
2) Retrieve the downloaded whl file location, then run this command from your command line(Here I would show you the sample script I used):
az extension add --source C:\Users\merlinl\Downloads\azure_devops-0.18.0-py2.py3-none-any.whl
3) Now you will see that the azure-devops installed successfully.
Check your CLI version.
You must have at least v2.0.69, which you can verify with az --version command. Refer to this.

Cannot install Azure Dev Spaces using cloud shell in AKS

When i run the below command in cloud shell.
az aks use-dev-spaces -g aksrgrp -n akscluster
I get the below error. Any help will be highly appreciated
You may be prompted for your administrator password to authorize the installation process.
/tmp/tmpy1vng2we/azds-linux-setup.sh: line 84: sudo: command not found
/tmp/tmpy1vng2we/azds-linux-setup.sh: line 112: sudo: command not found
[INFO] Failed to install dotnet core dependencies.
[INFO] You can manually install all required dependencies based on the following documentation:
[FATAL] https://www.microsoft.com/net/download/dotnet-core/2.1
Azure Dev Spaces CLI not installed properly. Visit 'https://aka.ms/get-azds' for Azure Dev Spaces.
The error shows why the issue happens. It cannot find the command azds. Because the cloud shell does not install the command tool. You can find all the command tools installed in the cloud shell here.
I suggest you can install the tool which you need in the Azure VM of the azure Kubernetes, if you do not find the tool what you want.
It's a better way for you. By the way, the Cloud Shell just enables access to a browser-based command-line experience built with Azure management tasks in mind. So install the Azure CLI in the VM is a better experience.
To add to Charles's answer: the Azure Dev Spaces CLI currently does not support running in the Cloud Shell. Its functionality is designed more for running on your local dev machine where you application's source code is.

Serverless Framework sls Conflicts with Powershell sls (Select-string)

I installed the Serverless Framework using the following NPM command
npm install -g serverless
When I try to run the serverless command sls in Powershell, I get a strange result which mentions "cmdlet Select-string".
sls --version
Can someone help me with this issue?
It seems that PowerShell has a command/cmdlet called Select-String which has an alias of sls. The PowerShell alias sls seems to take precedence over the node.js serverless command of sls.
One way to remove the PowerShell sls alias is by running the following in PowerShell
Remove-Item alias:sls
This change only applies to the current PowerShell session.
To permanently the sls PowerShell alias, you can change Microsoft.PowerShell_profile.ps1 file.
From PowerShell open your profile page in Notepad with the following command:
notepad $profile
Add the following to the file and save.
remove-item alias:sls
The profile can be reloaded by running the following from Powershell
. $profile
In my file, you will see that I have removed the aliases of curl and sls.
Now I see what I expect when entering sls in PowerShell.
How do I permanently remove a default Powershell alias?
--- Update ----
A more simple option is to use the command "serverless" instead of "sls".
For future visitors - in current version (if serverless is installed by npm/yarn) ^1.61 there is a secondary shortcut option:
slss
and that shortcut works flawlessly in Powershell. Imo it's the simplest way to avoid problems with Select-String alias collision and do not require any change in Powershell session or config.
PS C:\htdocs\serverless> slss -v
Framework Core: 1.61.1
Plugin: 3.2.7
SDK: 2.2.1
Components Core: 1.1.2
Components CLI: 1.4.0
If serverless is installed by chocolatey (as mentioned by #Nick Cox in comment) slss approach will fail, and you can use approach suggested by him - sls.exe
I was able to solve this issue by using Chocolaty.
Instead of npm install serverless use choco install serverless for windows,
Ref: https://www.serverless.com/framework/docs/getting-started/

Upgrade Python modules at Bluemix, to get out of the error (No trigger by the name “interval” was found)

I am using the ipython of apache spark service at bluemix. I need to reinstall setuptools, but I can't enter password for sudo. How can I proceed to make it work ( the goal is to fulfil the following actually )
https://bitbucket.org/agronholm/apscheduler/issues/77/lookuperror-no-trigger-by-the-name
Thanks,
Boris
You do not have root permissions with this service, so you cannot install anything at the system level and you cannot run sudo. If you want to install apscheduler, then run pip with the '--user' arg so that it installs local to your tenant.
Update: IBM has deployed new software levels last week. If you create a new Apache Spark service on Bluemix, your environment won't include the offending version of setuptools anymore.
original answer:
As Randy pointed out, you cannot reinstall setuptools. Until IBM upgrades that package, use the workaround mentioned in the issue you linked:
"In the meantime, you can instantiate the triggers manually"
https://bitbucket.org/agronholm/apscheduler/issues/77/lookuperror-no-trigger-by-the-name#comment-14180022
The author of apscheduler apparently added a check for the version of setuptools. You'll have to use an older version of apscheduler without that check.

Resources